#include "cmsis_os2.h"
#include "lvgl.h"


extern osMutexId_t LvglMutexHandle;


void StartLvglTask(void *argument)
{
    osMutexAcquire(LvglMutexHandle, osWaitForever);

    lv_obj_t* tabview = lv_tabview_create(lv_scr_act());        /* 创建选项卡视图 */
    lv_tabview_set_tab_bar_position(tabview, LV_DIR_TOP);       /* 设置选项卡方向 */
    lv_tabview_set_tab_bar_size(tabview,  50);                  /* 设置选项卡大小 */
    lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Tab 1");      /* 添加选项卡 1 */
    lv_obj_t* tab2 = lv_tabview_add_tab(tabview, "Tab 2");      /* 添加选项卡 2 */

    osMutexRelease(LvglMutexHandle);

    for(;;)
    {
        osMutexAcquire(LvglMutexHandle, osWaitForever);
        lv_timer_handler();
        osMutexRelease(LvglMutexHandle);
        osDelay(5);
    }
}
